Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download Faculty Leaves Planning Report tabs as spreadsheet #113

Merged
merged 47 commits into from
Mar 1, 2024

Conversation

jxjj
Copy link
Contributor

@jxjj jxjj commented Feb 29, 2024

ScreenShot 2024-02-29 at 17 45 12

Allows users to download the Instructors, TAs, and Courses data from the Faculty Leaves Planning Report page.

  • When download is clicked, a single spreadsheet is created with 3 tabs.
  • Spreadsheet generation respects any checked filters.
  • XLSX (SheetJS) package is used to assemble the data into file.
  • At first, I tried to just walk the dom and translate the rendered table into the spreadsheet, but that was problematic and only allowed one sheet to be generated. Instead, this adds helpers to derive data from a set of course planninglookups and filters.

Web Workers

Spreadsheet creation can take awhile on larger groups (ANTH, HIST). It blocks the main thread, making the browser unresponsive, and sometimes prompting the user to kill the page.

To resolve this, I moved spreadsheet work into Web Workers.

There's a known issue using web workers using vite, laravel, and typescript. As a workaround, I created a ViteWorker wrapper for Worker.

Web workers resolved the browser lock-up issue, but the creation of some spreadsheets still takes long enough that you begin to wonder if the spinner will actually stop. To improve this, the user is shown progress. (The progress is faked a little, since we can't only tell when sheet calculation is complete).

On dev for testing: https://cla-groups-dev.oit.umn.edu/course-planning/groups/6

jxjj added 30 commits February 22, 2024 12:36
Going to transform the table into json to get the format we want, rather than munging the table DOM.

We'll use `usePersonTableData` composable to do the work. But, I want to test it to make sure it's not messing things up.

If this works, we could probably eliminate a bunch of logic within the PersonTable components and just use the records from `usePersonTableData`
fixes extrra people showing up on the "TA" tab
classNumber was missing in ApiResource and added in a previoius commit
in filename, scrub groupname of special chars
termId is not a value on leave... it's an array, so groupBy won't work
@jxjj jxjj requested a review from cmcfadden February 29, 2024 23:49
@jxjj jxjj self-assigned this Feb 29, 2024
@jxjj jxjj linked an issue Feb 29, 2024 that may be closed by this pull request
@jxjj jxjj merged commit 57eebe2 into develop Mar 1, 2024
2 checks passed
@jxjj jxjj deleted the feature/101-Add-ability-to-download-course-planning branch March 1, 2024 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ability to download course planning
2 participants